package com.lt.experiment05.mission02;

/**
 * @author LT
 * @version 1.0
 * @PackageName com.lt.experiment05.mission02
 * @ClassName Leaf
 * @Description to do
 * @date 2021/11/16 11:59
 */
public class Leaf extends Component{
    @Override
    public void operation() {
        System.out.print("Leaf、");
    }

    @Override
    public void add(Component c) throws Exception {
        throw new Exception("不支持该操作");
    }

    @Override
    public void remove(Component c) throws Exception {
        throw new Exception("不支持该操作");
    }

    @Override
    public Component getChild(int i) throws Exception {
        throw new Exception("不支持该操作");
    }

    @Override
    public void print(){
        this.operation();
    }
}
